<?php


namespace App\Models\MongoDb;

use Jenssegers\Mongodb\Eloquent\Model;

class MongoDbModel extends Model {

    protected $connection = 'mongodb';

    const TRUE = 1;

    const FALSE = 2;
    /**
     * 时间区间筛选
     * @param $format
     * @return array
     */
    public function handleBetweenFormat($format)
    {
        if (is_array($format)) {
            count($format) === 2 && $res = $format;
        } else if (is_string($format)) {
            $format = explode(',', $format);
            count($format) === 2 && $res = $format;
        }

        return $res ?? [];
    }


}
